<?php

class ApiSpotsController extends ApiAppController {
	
	public $uses = array('Spot');
	
	public function beforeFilter() {
		parent::beforeFilter();
	}
	
	public function test() {
		$result = array (
			'status' => 1
		);
		$this->set('result', $result);
		$this->set('_serialize', array('result'));
	}
	
	public function search() {
		$results = $this->Spot->search('all', array (
			'recursive' => -1,
			'center' => array (
				'latitude' => 40.707,
				'longitude' => -74.002,
				'radius' => 5.0	// Km
			)
		));
		$this->set('result', $results);
		$this->set('_serialize', array('result'));
	}
	
}